package com.quanyan.authority.model.response;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/1.
 */
public class RespMenu implements Serializable {

    private static final long serialVersionUID = 5003991025015236047L;

    private Integer id;

    private String name;

    private String icon;

    private String url;

    private Integer parentId;

    private Integer sort;

    private Byte type;

    private Byte isDelete;

    private Integer cityId;

    private List<RespMenu> children = new ArrayList();


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }


    public List<RespMenu> getChildren() {
        return children;
    }

    public void setChildren(List<RespMenu> children) {
        this.children = children;
    }

    public Byte getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Byte isDelete) {
        this.isDelete = isDelete;
    }


    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    @Override
    public String toString() {
        return "RespMenu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", icon='" + icon + '\'' +
                ", url='" + url + '\'' +
                ", parentId=" + parentId +
                ", sort=" + sort +
                ", type=" + type +
                ", isDelete=" + isDelete +
                ", cityId=" + cityId +
                ", children=" + children +
                '}';
    }

    @Override
    public int hashCode() {
        return  sort != null ? sort.hashCode() : 0 ;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RespMenu that = (RespMenu) o;

        return !(sort != null ? !sort.equals(that.sort) : that.sort != null);
    }
}
